/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pruebaes.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author luisfernando
 */
@Entity
@Table(name = "cabeceraspermiso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cabeceraspermiso.findAll", query = "SELECT c FROM Cabeceraspermiso c"),
    @NamedQuery(name = "Cabeceraspermiso.findById", query = "SELECT c FROM Cabeceraspermiso c WHERE c.id = :id"),
    @NamedQuery(name = "Cabeceraspermiso.findByTexto", query = "SELECT c FROM Cabeceraspermiso c WHERE c.texto = :texto"),
    @NamedQuery(name = "Cabeceraspermiso.findByValortexto", query = "SELECT c FROM Cabeceraspermiso c WHERE c.valortexto = :valortexto")})
public class Cabeceraspermiso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 2147483647)
    @Column(name = "texto")
    private String texto;
    @Size(max = 2147483647)
    @Column(name = "valortexto")
    private String valortexto;
    @JoinColumn(name = "permiso", referencedColumnName = "id")
    @ManyToOne
    private Permisos permiso;

    public Cabeceraspermiso() {
    }

    public Cabeceraspermiso(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTexto() {
        return texto;
    }

    public void setTexto(String texto) {
        this.texto = texto;
    }

    public String getValortexto() {
        return valortexto;
    }

    public void setValortexto(String valortexto) {
        this.valortexto = valortexto;
    }

    public Permisos getPermiso() {
        return permiso;
    }

    public void setPermiso(Permisos permiso) {
        this.permiso = permiso;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cabeceraspermiso)) {
            return false;
        }
        Cabeceraspermiso other = (Cabeceraspermiso) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pruebaes.entidades.Cabeceraspermiso[ id=" + id + " ]";
    }
    
}
